//
//  HMVisitorView.m
//  weiboOC
//
//  Created by 刘耀宗 on 16/4/8.
//  Copyright © 2016年 刘耀宗. All rights reserved.
////消息文字


#import "HMVisitorView.h"
@interface HMVisitorView ()

//遮盖

@property (weak, nonatomic) IBOutlet UIImageView *coverView;
//小房子


@property (weak, nonatomic) IBOutlet UILabel *textLabel;
//登录

@property (weak, nonatomic) IBOutlet UIButton *loginBtn;
//注册按钮

@property (weak, nonatomic) IBOutlet UIButton *registerBtn;

@end

@implementation HMVisitorView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
       [self prepareUI];
    }
    return self;
}
- (instancetype)initWithCoder:(NSCoder *)coder
{
    self = [super initWithCoder:coder];
    if (self) {
        [self prepareUI];
    }
    return self;
}
-(void)awakeFromNib
{
    [super awakeFromNib];
    [self prepareUI];


}
- (instancetype)init
{
    self = [super init];
    if (self) {
        [self prepareUI];
    }
    return self;
}
-(void)prepareUI
{   //self.loginBtn
    [self.loginBtn setTitle:@"登录" forState:UIControlStateNormal];
    [self.loginBtn  setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
    //注册单击事件
    [self.loginBtn addTarget:self action:@selector(loginClick) forControlEvents:UIControlEventTouchUpInside];
    
//    UILabel *label=[[UILabel alloc] init];
    
    self.textLabel.text=@"关注一些人!看看有神马惊喜!";
    NSLog(@"%@",self.textLabel);
    NSLog(@"%@",self.textLabel.text);
    self.textLabel.font=[UIFont systemFontOfSize:18];
    //允许换行
    self.textLabel.numberOfLines=0;
    self.textLabel.textAlignment=NSTextAlignmentCenter;
//    self.textLabel=label;
    [self.registerBtn setTitle:@"注册" forState:UIControlStateNormal];
    [self.registerBtn setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
    [self.registerBtn addTarget:self action:@selector(registerClick) forControlEvents:UIControlEventTouchUpInside];

    
    }
//注册按钮点击
-(void)registerClick
{
    if ([self.delegate respondsToSelector:@selector(regins)]) {
        [self.delegate regins];
    }

}
//登录按钮点击
-(void)loginClick
{
    if ([self.delegate respondsToSelector:@selector(login)]) {
        [self.delegate login];
    }


}
-(void)setImage:(UIImage *)image
{
    _image=image;
    
self.coverView.image= image;

}
+(instancetype)ViewWithXib
{
    return [[[NSBundle mainBundle] loadNibNamed:@"HMVisitorView" owner:nil options:nil] lastObject];


}


@end
